package net.wantongtech.xa.uploadbasicinfo.dao;

import com.wtkj.dao.impl.BaseDataTemplate;
import org.springframework.stereotype.Repository;

import java.sql.ResultSet;

/**
 * 检测下载缺失版本DAO
 *
 * @author MaShibo
 * 日期 :  2020/2/10
 */
@Repository
public class CheckMissingVersionDao extends BaseDataTemplate {

    public boolean existsVersion(String version, Integer bizCode) {
        final String sql =
                "SELECT 1\n" +
                        "  FROM etc_messagedownloadopt a\n" +
                        " WHERE a.bizcode = ?\n" +
                        "   AND a.version = ?";
        return jdbcTemplate.query(sql, ResultSet::next, bizCode, version);
    }
}
